import request from '@/utils/request'

// 查询仓库进货单列表
export function getPurchaseOrder(query) {
  return request({
    url: '/basic/warehouse/purchaseOrder/',
    method: 'get',
    params: query
  })
}


// 查询仓库进货单详细
export function getPurchaseOrderDetail(dictCode) {
  return request({
    url: '/basic/warehouse/purchaseOrder/' + dictCode,
    method: 'get'
  })
}


// 删除仓库进货单
export function delPurchaseOrder(query) {
  return request({
    url: '/basic/warehouse/purchaseOrder/'+query,
    method: 'delete'
  })
}


// 新增仓库进货单
export function addPurchaseOrder(query) {
  return request({
    url: '/basic/warehouse/purchaseOrder/',
    method: 'post',
    data: query
  })
}

// 修改仓库进货单
export function updatePurchaseOrder(query) {
  return request({
    url: '/basic/warehouse/purchaseOrder/',
    method: 'put',
    data: query
  })
}

//确认进货单
export function confirmPurchaseOrder(query) {
  return request({
    url: '/basic/warehouse/purchaseOrder/confirm',
    method: 'post',
    params: query
  })
}

//进货单明细列表
export function particularsList(query) {
  return request({
    url: '/basic/warehouse/purchaseOrder/particulars',
    method: 'get',
    params: query
  })
}
//进货单明细详情
export function particularDetail(id) {
  return request({
    url: '/basic/warehouse/purchaseOrderDetail/particulars/'+ id,
    method: 'get'
  })
}
//进货单明细汇总
export function particularSum(query) {
  return request({
    url: '/basic/warehouse/purchaseOrderDetail/all/particulars',
    method: 'get',
    params: query
  })
}
